<template>
  <div id="nav">
    <!-- 导航栏 -->
    <aside>
      <el-row class="tac">
        <h5><span class="el-icon-dish"></span> 外卖商家中心</h5>
        <el-col :span="12">
          <el-menu
            default-active="2"
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b"
          >
            <el-menu-item index="1">
              <i class="el-icon-s-home"></i>
              <span slot="title">后台首页</span>
            </el-menu-item>
            <el-menu-item index="2">
              <i class="el-icon-document"></i>
              <span slot="title">订单管理</span>
            </el-menu-item>
            <el-submenu index="3">
              <template slot="title">
                <i class="el-icon-shopping-bag-2"></i>
                <span>商品管理</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="1-1">商品列表</el-menu-item>
                <el-menu-item index="1-2">商品添加</el-menu-item>
                <el-menu-item index="1-3">商品分类</el-menu-item>
              </el-menu-item-group>
            </el-submenu>

            <el-menu-item index="4">
              <i class="el-icon-s-shop"></i>
              <span slot="title">店铺管理</span>
            </el-menu-item>
            <el-submenu index="5">
              <template slot="title">
                <i class="el-icon-user"></i>
                <span>账号管理</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="1-1">账号列表</el-menu-item>
                <el-menu-item index="1-2">添加账号</el-menu-item>
                <el-menu-item index="1-3">修改密码</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
            <el-submenu index="6">
              <template slot="title">
                <i class="el-icon-pie-chart"></i>
                <span>销售统计</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="1-1">商品统计</el-menu-item>
                <el-menu-item index="1-2">订单统计</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
          </el-menu>
        </el-col>
      </el-row>
    </aside>
    <div id="home">
      <header>
        <p>首页 / 商品添加</p>
        <div>欢迎你，xxxx <img src="#" alt="" /></div>

      </header>
      <main>
         <!-- <changePwd></changePwd> -->
         <user></user>
      </main>
     
    </div>
  </div>
</template>

<script>
    import changePwd from "@/views/changepwd.vue";
    import user from "@/views/user.vue";
export default {
    components:{
        changePwd,
        user

    },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
  },
};
</script>

<style lang="less" scoped>
#nav {
  display: flex;
  background-color: #f0f2f5;
  #home{
    flex: 1;
    main{
      
        padding: 20px;
 
    }

  

  header {
    display: flex;
    flex: 1;
    width: 100%;
    height: 60px;
    line-height: 60px;
    justify-content: space-between;
    background-color: #fff;
    margin-bottom: 10px;
    flex-direction: row;
    p {
      padding-left: 10px;
    }
    div {
        padding-right: 40px;
    }
  }}

  aside {
    width: 211px;
    display: flex;
    height: 100%;

    background-color: #545c64;
    i {
      color: #fff;
    }
    h5 {
      font-size: 20px;
      color: #fff;
      text-align: center;
      margin: 10px;
      span {
        display: inline-block;
        width: 50px;
        line-height: 50px;
        font-size: 30px;
        background-color: #1296db;
        border-radius: 50%;
      }
    }
  }
  .tac {
    height: 100%;
  }
  .el-menu-vertical-demo:not(.el-menu--collapse) {
    width: 210px;
    min-height: 50%;
    flex: 1;
  }
}
</style>